| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkImages::Image Class Referencefinal

Holds all information required for an image, with ownership over the data. More...

Inheritance diagram for nkImages::Image:

## Public Member Functions
| Image () noexcept
| Image (nkMemory::Buffer &&data) noexcept
| Image (nkMemory::Buffer &&data, unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0) noexcept
| Image (nkMemory::Buffer &&data, unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0) noexcept
| Image (nkMemory::Buffer &&data, nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false) noexcept
| Image (const Image &other) noexcept
| Image (Image &&other) noexcept
| Image (const ImageView &view) noexcept
virtual | ~Image ()
virtual unsigned char * | getDataPtr () const override
virtual unsigned long long | getDataByteSize () const override
virtual nkMemory::BufferView | getDataBuffer () const override
virtual bool | isView () const override
const nkMemory::Buffer & | getData () const
Image & | operator= (const Image &other) noexcept
Image & | operator= (Image &&other) noexcept
Public Member Functions inherited from nkImages::ImageBase
| ImageBase () noexcept
| ImageBase (unsigned int width, unsigned int height, unsigned int depth, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0, unsigned int rowByteSize=0, unsigned int sliceByteSize=0) noexcept
| ImageBase (unsigned int width, unsigned int height, unsigned int depth, unsigned int arraySize, unsigned int mips, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize=0) noexcept
| ImageBase (nkMemory::BufferCast< ImageDescriptor > &&images, PIXEL_FORMAT format, unsigned int pixelOrBlockByteSize, bool alphaPremultiplied=false, bool cubeMap=false) noexcept
| ImageBase (const ImageBase &other) noexcept
| ImageBase (ImageBase &&other) noexcept
virtual | ~ImageBase ()
unsigned int | getWidth (unsigned int mip=0u) const
unsigned int | getHeight (unsigned int mip=0u) const
unsigned int | getDepthOrArraySize (unsigned int mip=0u) const
unsigned int | getMipCount () const
PIXEL_FORMAT | getFormat () const
unsigned int | getPixelByteSize () const
unsigned int | getRowByteSize (unsigned int mip=0u) const
unsigned int | getSliceByteSize (unsigned int mip=0u) const
bool | getAlphaPremultiplied () const
bool | getCubeMap () const
bool | isArray () const
void | setFormat (PIXEL_FORMAT value)
void | setPixelOrBlockByteSize (unsigned int value)
void | setAlphaPremultiplied (bool value)
void | setCubeMap (bool value)
nkMaths::Vector | getPixel (unsigned int x, unsigned int y, unsigned int z=0u, unsigned int mip=0u) const
void | setPixel (nkMaths::Vector v, unsigned int x, unsigned int y, unsigned int z=0u, unsigned int mip=0u)
Image | decompress (const AlignmentDescriptor &alignmentDescriptor=AlignmentDescriptor()) const
ImageBase & | operator= (const ImageBase &other) noexcept
ImageBase & | operator= (ImageBase &&other) noexcept

## Detailed Description

Holds all information required for an image, with ownership over the data.

See ImageBase for more information.

## Constructor & Destructor Documentation

## ◆ Image() [1/8]

nkImages::Image::Image | ( |  | ) |
| noexcept

Default constructor.

## ◆ Image() [2/8]

nkImages::Image::Image | ( | nkMemory::Buffer && | data | ) |
| noexcept

Data-move constructor.

Parameters

  data | The buffer which data should be part of the image.

## ◆ Image() [3/8]

nkImages::Image::Image | ( | nkMemory::Buffer && | data,
|  | unsigned int | width,
|  | unsigned int | height,
|  | unsigned int | depth,
|  | PIXEL_FORMAT | format,
|  | unsigned int | pixelOrBlockByteSize = `0`,
|  | unsigned int | rowByteSize = `0`,
|  | unsigned int | sliceByteSize = `0`
| ) |  |
| noexcept

2D image without mips constructor.

Parameters

  data | The buffer which data should be part of the image.
  width | The width of the image, in pixels.
  height | The height of the image, in pixels.
  depth | The depth of the image, in number of slices of width * height images.
  format | The format of the image.
  pixelOrBlockByteSize | The size of a pixel or block, in bytes. Defaults to 0 to be automatically derived from the format.
  rowByteSize | The size of a row, in bytes. Defaults to 0 to be automatically derived from the pixel byte size and width.
  sliceByteSize | The size of a slice, in bytes. Defaults to 0 to be automatically derived from the row size size and height.

## ◆ Image() [4/8]

nkImages::Image::Image | ( | nkMemory::Buffer && | data,
|  | unsigned int | width,
|  | unsigned int | height,
|  | unsigned int | depth,
|  | unsigned int | arraySize,
|  | unsigned int | mips,
|  | PIXEL_FORMAT | format,
|  | unsigned int | pixelOrBlockByteSize = `0`
| ) |  |
| noexcept

Tightly packed full constructor. Will derive all information for slices and mips based on width, height, depth and format given / pixelOrBlockSize given. Memory will be assumed as being tightly packed (no padding inside).

Parameters

  data | The buffer which data should be part of the image.
  width | The width of the image, in pixels.
  height | The height of the image, in pixels.
  depth | The depth of the image, in number of slices of width * height images.
  arraySize | The number of slice in the image array.
  mips | The number of mips for each image slice.
  format | The pixel format of the image.
  pixelOrBlockByteSize | The size of a pixel or block, in bytes. Defaults to 0 to be automatically derived from the format.

## ◆ Image() [5/8]

nkImages::Image::Image | ( | nkMemory::Buffer && | data,
|  | nkMemory::BufferCast< ImageDescriptor > && | images,
|  | PIXEL_FORMAT | format,
|  | unsigned int | pixelOrBlockByteSize,
|  | bool | alphaPremultiplied = `false`,
|  | bool | cubeMap = `false`
| ) |  |
| noexcept

Full constructor.

Parameters

  data | The buffer which data should be part of the image.
  images | The sub-images constituting the full image. One entry corresponds to an entry within a 2D image array.
  format | The pixel format of the image.
  pixelOrBlockByteSize | The size of a pixel or block, in bytes.
  alphaPremultiplied | Whether the alpha is premultiplied (true) or not (false).
  cubeMap | Whether the image is a cube map (true) or not (false).

## ◆ Image() [6/8]

nkImages::Image::Image | ( | const Image & | other | ) |
| noexcept

Copy constructor. Will make a copy of the data.

Parameters

  other | The image to copy from.

## ◆ Image() [7/8]

nkImages::Image::Image | ( | Image && | other | ) |
| noexcept

Move constructor. Will move the data over.

Parameters

  other | The image to move.

## ◆ Image() [8/8]

nkImages::Image::Image | ( | const ImageView & | view | ) |
| noexcept

Copy constructor, from a view. Will make a copy of the data.

Parameters

  view | The view to copy from.

## ◆ ~Image()

virtual nkImages::Image::~Image | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ getDataPtr()

virtual unsigned char* nkImages::Image::getDataPtr | ( |  | ) | const
| override virtual

Returns
  A pointer over the image data.

Implements nkImages::ImageBase.

## ◆ getDataByteSize()

virtual unsigned long long nkImages::Image::getDataByteSize | ( |  | ) | const
| override virtual

Returns
  The total byte size of the image buffer.

Implements nkImages::ImageBase.

## ◆ getDataBuffer()

virtual nkMemory::BufferView nkImages::Image::getDataBuffer | ( |  | ) | const
| override virtual

Returns
  A view over the raw image data.

Implements nkImages::ImageBase.

## ◆ isView()

virtual bool nkImages::Image::isView | ( |  | ) | const
| override virtual

Returns
  Whether the image is a view over the data without ownership (true) or not (false).

Implements nkImages::ImageBase.

## ◆ getData()

const nkMemory::Buffer& nkImages::Image::getData | ( |  | ) | const

Returns
  A reference over the internal buffer holding the image data.

## ◆ operator=() [1/2]

Image& nkImages::Image::operator= | ( | const Image & | other | ) |
| noexcept

Copy assignment operator.

Parameters

  other | The image to copy and assign.

## ◆ operator=() [2/2]

Image& nkImages::Image::operator= | ( | Image && | other | ) |
| noexcept

Move assignment operator.

Parameters

  other | The image to move and assign.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsImages/Data/Image.h